﻿#region File and License Information
/*
<File>
	<License>
		Copyright © 2009 - 2017, Daniel Vaughan. All rights reserved.
		This file is part of Calcium (http://calciumsdk.net), 
		which is released under the MIT License.
		See file /Documentation/License.txt for details.
	</License>
	<CreationDate>2010-12-27 15:13:08Z</CreationDate>
</File>
*/
#endregion

using System;
using System.Collections.Generic;

namespace Outcoder.InversionOfControl
{
	public interface IContainer
	{
		void Register<TFrom, TTo>(bool singleton = false, string key = null) where TTo : TFrom;
		void Register(Type fromType, Type toType, bool singleton = false, string key = null);
		void Register<TInterface>(TInterface instance, string key = null);
		void Register<T>(Func<T> getInstanceFunc, bool singleton = false, string key = null);
		void Register(Type type, Func<object> getInstanceFunc, bool singleton = false, string key = null);
		void Register(Type type, object instance, string key = null);
		bool IsRegistered<T>(string key = null);
        bool IsRegistered(Type fromType, string key = null);
		T Resolve<T>(string key = null);
		object Resolve(Type type, string key = null);
		IEnumerable<TFrom> ResolveAll<TFrom>() where TFrom : class;
		IEnumerable<Object> ResolveAll(Type fromType);
		IEnumerable<object> ResolveAll(string key);
	}
}